use serde::{Deserialize, Serialize};

#[derive(Deserialize, Serialize, Debug, Default)]
pub struct Idea {
    pub id: u32,
    pub title: String,
    pub content: String,
    pub tags: Vec<String>,
    pub views: u32,
    pub stars: u32,
    pub created_at: String,
}

#[derive(Deserialize, Serialize, Debug, Default)]
pub struct AddRequest {
    pub title: String,
    pub content: String,
    pub tags: Vec<String>,
}

#[derive(Deserialize, Serialize, Debug, Default)]
pub struct UpdateRequest {
    pub id: u32,
    pub title: Option<String>,
    pub content: Option<String>,
    pub tags: Option<Vec<String>>,
}

#[derive(Deserialize, Serialize, Debug, Default)]
pub struct GetMutipleRequest {
    // Last id of previous page, or 0 if getting first page
    pub id: u32,

    // Page capacity
    pub count: u32,
}

#[derive(Deserialize, Serialize, Debug, Default)]
pub struct GetMutipleResponse {
    pub total_count: u32,
    pub idea_count: u32,
    pub ideas: Vec<Idea>,
}
